<?php


namespace App\Admin\Controller\Wechat;


use App\Admin\Controller\AdminBaseController;
use App\Admin\Services\Wechat\MiniProgramWechatTemplateService;
use Illuminate\Http\Request;

class MiniProgramWechatTemplateController extends AdminBaseController {
    private $_service;

    public function __construct(MiniProgramWechatTemplateService $service) {
        $this->_service = $service;
    }

    /**
     * 微信代码模板分页列表
     *
     * @param Request $request
     * @return mixed
     */
    public function page(Request $request) {
        return $this->success($this->_service->page($request));
    }

    /**
     * 删除微信代码模板
     *
     * @param $id
     * @return mixed
     * @throws \App\Admin\Exceptions\Wechat\CompanyMiniProgramException
     * @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException
     */
    public function delete($id) {
        return $this->success($this->_service->delete($id));
    }
}